﻿<Page
    x:Class="Wimm.UI.AddIncomePage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:Wimm.UI"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:c="using:Wimm.CustomContols"
    xmlns:converters="using:Wimm.Common.Converters"
    mc:Ignorable="d">
    <Page.Resources>
        <converters:StringFormatConverter x:Key="StringFormatConverter"/>
    </Page.Resources>
    <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
        <Grid.RowDefinitions>
            <RowDefinition Height="140"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <!-- Back button and page title -->
        <Grid Background="#00a2e8" >
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="120"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Button x:Name="BackButton" Margin="39,59,39,0" Click="BackButton_Click"
                        Style="{StaticResource NavigationBackButtonNormalStyle}"
                        VerticalAlignment="Top"
                        AutomationProperties.Name="Back"
                        AutomationProperties.AutomationId="BackButton"
                        AutomationProperties.ItemType="Navigation Button"/>
            <TextBlock x:Name="PageTitle" x:Uid="Section3HeaderIncomes" Text="Add my incomes" Style="{StaticResource HeaderTextBlockStyle}" Grid.Column="1" 
                        IsHitTestVisible="false" TextWrapping="NoWrap" VerticalAlignment="Bottom" Margin="0,0,30,40"/>
            </Grid>
        <!--for income-->
            <Grid x:Name="LayoutRoot" Grid.Row="1">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="*"/>
                </Grid.RowDefinitions>
                <c:MoneyInputControl  AddButtonCommand="{Binding AddIncomeCommand}" Grid.Row="0"></c:MoneyInputControl>

            <GridView Grid.Row="1" HorizontalAlignment="Stretch"  ShowsScrollingPlaceholders="True" ItemsSource="{Binding Sourceincome}" SelectedItem="{Binding SelectedSource,Mode=TwoWay}">
                    <GridView.ItemTemplate>
                        <DataTemplate>
                            <Grid Width="320" Height="150" Margin="5">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>
                                <Image Source="{Binding Icon.FileName,Converter={StaticResource StringFormatConverter},ConverterParameter='Assets/icon/iconIncame/{0}'}"  Height="100" Width="150" Grid.Row="0"/>
                            <TextBlock Text="{Binding LocalDescription}" 
                                    FontSize="22" HorizontalAlignment="Center" VerticalAlignment="Center"
                                    FontFamily="Lucida Sans Unicode" Grid.Row="1"></TextBlock>
                            </Grid>
                        </DataTemplate>
                    </GridView.ItemTemplate>
                </GridView>
            </Grid>
    </Grid>
</Page>
